<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'block-form',
    'enableAjaxValidation' => true,
    'enableClientValidation' => true,
    'type' => 'horizontal',
    'htmlOptions' => array(
        'enctype'=> 'multipart/form-data'
    )
));
?>

<?php echo $form->errorSummary($model); ?>

<?php echo $form->hiddenField($model, 'type'); ?>

<?php echo $form->textFieldRow($model, 'name'); ?>

<?php
//$current_type_name = (strpos($type, '.') === false) ? $type : substr($type, strrpos($type, '.') + 1);
$this->renderPartial('common.blocks.'.$model->type.'.block_input', array(
    'model' => $model,
    'blockModel' => $blockModel,
    'form' => $form
));
?>
<div class="form-actions">
    <input type="submit" value="Save" class="btn btn-primary" />
</div>
<?php $this->endWidget(); ?>